﻿//*** Guidance generated code ***//
using System;
using System.Collections.Generic;
using System.Linq;

using Survey.Common;
using Survey.Common.Data.Services;
using Survey.Entity.Services;

namespace Survey.Business.Services
{
    public class UserProfileFilterValidator : FilterValidatorBase<UserProfileFilter, int>
    {
        // filter rules
    }
    public class UserProfileValidator : EntityValidatorBase<UserProfile, int, IUserProfileDao>
    {
        protected override void Init(RuleCollection<UserProfile> rules)
        {
            // string
            rules.For(entity => entity.UserName).RequireLengthBetween(1, 999);

            // dates
            rules.For(entity => entity.LastActivityDate)
                .RequireValueBetween(Ext.MinDatumCommon, Ext.MaxDatumCommon);
            rules.For(entity => entity.LastUpdateDate)
                .RequireValueBetween(Ext.MinDatumCommon, Ext.MaxDatumCommon);
        }
    }
}
